package model

const TableNameUser = "users"

// User mapped from table <users>
type Users struct {
	Uid          int    `xorm:"not null pk autoincr INT"`
	Username     string `xorm:"not null unique VARCHAR(32)"`
	Password     string `xorm:"not null VARCHAR(32)"`
	Nickname     string `xorm:"not null VARCHAR(32)"`
	Avatar       string `xorm:"not null default '12' VARCHAR(255)"`
	Bet          string `xorm:"not null default 0.00 DECIMAL(11,2)"`
	RegisterTime int    `xorm:"not null index INT"`
	LoginTime    int    `xorm:"not null default 0 INT"`
	Status       int    `xorm:"not null default 1 comment('0封禁1正常2结算中') TINYINT(1)"`
	Income       string `xorm:"not null default 0.00 DECIMAL(11,2)"`
	Takeout      string `xorm:"not null default 0.00 DECIMAL(11,2)"`
	Version      int    `xorm:"not null default 0 INT"`
	Webid        int    `xorm:"not null default 66 index SMALLINT"`
}

// TableName User's table name
func (u *Users) TableName() string {
	return TableNameUser
}

func (u *Users) GetGuid() int64 {
	return int64(u.Uid)
}
